{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0123456789+-*() \n",
      "17\n"
     ]
    }
   ],
   "source": [
    "import string\n",
    "import os\n",
    "\n",
    "digits = string.digits\n",
    "operators = '+-*'\n",
    "characters = digits + operators + '() '\n",
    "print(characters)\n",
    "\n",
    "width, height, n_len, n_class = 180, 60, 7, len(characters) + 1\n",
    "print(n_class)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAALQAAAA8CAIAAABATAfQAAAaFklEQVR4nO1923bUSJruHxGSIqQ8\np0+YQ4ExR3Omqqd793SvNfshZu2LWWu/wVzsZ5lnmKt5hNl7d890TR2oogADBgPGUBgbYzJTqcxU\nHKSImAvZ6bSdmU7oKsqu5lu+sKWQFFJ88Z8jjGQ9hBHw//7876/XH/zv//V/Rmn8CQcZ//pv/5L9\n8k//+M/DW6Ih5JCSR63G0vJCsTj+ZOm+z/wbV/7H5MSxn7Cjn/CR0R3T2Zm5YqFCqT+ksTP8Lnfm\nv0p1uvrmVZKmruNaa3+GDn/CzwUpefZLlwSU+kWAG1f/vvfgIOAh55aWFwCA8ziXq0gZJ0liPpHj\n8GBrev9X1Gp0WQIAlPrZz753GEaO2Zm5YqF84dyNZrOhtbHGWvMTdPpnBRdxI6w3wjoXfP/Wv150\nBX/UCrNJ/gEYqFa68mf1zQrCOE0Nxp7juB/a248EIfndB7eESG5e/Q1GmFL6S/foF0OXE7Mzcx92\nh2GSg1LfWoQxNia1QKqVacfxPuwxHw1KqVarGYYbj54sSCV/6e78ksgE/42rv9/X8ByEYeQAACH5\n02eLSomA5RjzffYhz/iYYNQv5McArBCx+BvWLJT6xULlxtW//2BmwBC1AtksbDcbzXWjbblUPHni\npOMMa78XfGuEfBawj0IsRv3zZy7U6+sxD7nocMEHEXqvJf8rw1//X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IQxTrTZv6h85xMpzU2M\nHxne0mfBtStfAACj7JDGu/rCgZ6QMCaEYAoAjkMp9dmeSYAAAcKYYOJhQrKSSWstIoQWilXHswi5\nMNpm2++7320GSv258188fnovF4zngvzwCb2z55m7Q943szJKnc4o3tlhhAMA3ZCwUhIhhJGDkNO3\n7oGxIJfPxyIPJukGR41BxXzlytx1P2CvV5dGyXd8MDJpf/3y7wHgfedopv5Glxyf4ABAd/n9zMm5\nnJ+Lg5zP8rjf6kWf+Tev/G7+4S1jFEZIKhHzOEkk9fxSqVouFSfHj8DPvMPViFHzvUCAEPpEjfeA\n86//9i8TY9MAMDszZ7T97LOZ9drrQa0ZC8oAv/38H6TkCCEp+ZPnD7xmO1vqeGBXAkoplVKO6zHm\nHYqFRgcEzj/94z9/893/zXQBF2L5wS0AiHlkbH//nrGA9axSzOfLQkrqsZ9p34GfBMboVys/Us87\nd/bywf/HDwcHDvSEhMNm0xosRExpYPtV1e7CB0v4jwytTalUSnTMqI/QpgF+KHr+y2I7ZQ8APvM9\nyhjLEYQQ/vVoZ8dxcrl8PlcA1L9s8RP6YodLQimdu3DFZ3mPukkihy9UPETABDOWO3nirJTi4O/+\neXCwixysVCj//rf/4LP823cr6nDWTO8FwWRibDLwc69XN6uRD+MuKx8fu4MZ2a7h589eRRD8av5H\nGtnCX/9vz/6m0CdMyah/bPqzP/3nf3x+/Tcfv0M/Hyj1J6g/MX70l+7IocF/AyZx5K+jkqCfAAAA\nAElFTkSuQmCC\n",
      "text/plain": [
       "<PIL.Image.Image image mode=RGB size=180x60 at 0x103AC9490>"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from captcha.image import ImageCaptcha\n",
    "generator = ImageCaptcha(width=width, height=height, font_sizes=range(35, 56), \n",
    "                         fonts=['fonts/%s'%x for x in os.listdir('fonts') if '.tt' in x])\n",
    "generator.generate_image('(1-2)-3')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata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t8ezmdj3f8Td7LkW0F1QvF\nUY+CMkoZdQMXAESRe+OBSLiWOttLHvyHT+ASIelnd9aLhNcf7vD9lBR9IFe2O4ZQ4pS82bcWNo2J\n/t8+RNKkCgwgjQBAS6UyGW123VrQ/MXmxDtzp5UziH7115SX/Bz3c9bj/rgSQpySJzKOsEUdSi6R\nVTrQG/JOtvqfv+j/8gonkEh4thkZBHTKvdpDQimjbtUrzJctC/U+3xdtiTNksOmfKJHuxyRg1KcX\nyQrm3Wzq+zfg5dZG4YKH1D5NLr+aeNIAVxuS7sMIbVmWXXBm3pjvZ/dcIQglU7dm0lJR7nFEkewK\nA1pRg0KL3QywRK/95bcvkhX8knNigOu8NeF5bPWMm+HmL1f9ucL48pRTeC5uShHztJ3UP9/NTRat\ntXKZI4YJIf54YfkP/6AwPcy5QS83XpkrNS6IPMoEFxhbzHdOPDHhSiAzqaRK2vHu4y0lpOSSBmxi\naao0VraHdxK+MAw7G79u5NBaa6UsjJ/XhukjEBmXQopMAAJMMHXo2SkE14sRzq78upFjEP25fJbe\n1wmjnYv60l3Gc0lF5PecOA0jJBi/UBl47lngL+DMid9ZjHBs/PnLylXZFOeuedd+Pyhc9xUWzxXh\nWqf/obBYvuAj50iOq5rKF7wD4HqPgv8ay628k/Fu9vA//oZ3h7jF4SxyXO2tDhcZ+NFuzLgSvAxX\nWDwnjPxq5ywrV3tH9zVeNn4RfI0vJB/t1f4/pWJkEUGt7CYAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<PIL.Image.Image image mode=RGB size=180x60 at 0x103A9BE10>"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from image import ImageCaptcha\n",
    "generator = ImageCaptcha(width=width, height=height, font_sizes=range(35, 56), \n",
    "                         fonts=['fonts/%s'%x for x in os.listdir('fonts') if '.tt' in x])\n",
    "generator.generate_image('(1-2)-3')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
